package com.example.bankend.service.method;



import com.example.bankend.mapper.CustomerMapper;
import com.example.bankend.model.Customer;
import com.example.bankend.service.impl.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CustomerServiceImpl implements CustomerService {
    @Autowired
    private CustomerMapper customerMapper;

    @Override
    public int insert(Customer customer) {
//        System.out.println(customer.getAddress());
        return customerMapper.insert(customer);
    }

    @Override
    public int deleteByPrimaryKey(Long customerID) {
        return customerMapper.deleteByPrimaryKey(customerID);
    }

    @Override
    public int updateByPrimaryKey(Customer customer) {
        return customerMapper.updateByPrimaryKey(customer);
    }

    @Override
    public Customer selectByPrimaryKey(Long customerID) {
        return customerMapper.selectByPrimaryKey(customerID);
    }

    @Override
    public Customer selectByPrimaryKey1(String pid) {
        return customerMapper.selectByPrimaryKey1(pid);
    }
    @Override
    public int countAllUsers() {
        return customerMapper.countAllUsers();
    }
    @Override
    public List<Customer> selectAll() {
        return customerMapper.selectAll();
    }
}
